package com.ktjiaoyu.server.controller;

import com.ktjiaoyu.server.pojo.RespBean;
import com.ktjiaoyu.server.pojo.Salary;
import com.ktjiaoyu.server.service.ISalaryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/all")
public class StatisticsController {
    @Resource
    private ISalaryService salaryService;

    @ApiOperation("综合信息统计")
    @GetMapping(value = "/list")
    public RespBean toAdminAssignRole() {
        List<Salary> echarts = salaryService.selectSysMapBarList();
//        HashMap<String, Object> res = new HashMap<>();
//        List<String> name1 = new ArrayList<String>();         //存储姓名数组
//        List<Integer> basicSalary =new ArrayList<Integer>();   //存储基本工资数组
//        List<Integer> bonus =new ArrayList<Integer>();   //存储奖金数组
//        List<Integer> lunchSalary =new ArrayList<Integer>();   //存储无餐补助数组
//        for( int i = 0; i < echarts.size(); i++ ){
//            name1.add(echarts.get(i).getName());
//            basicSalary.add(echarts.get(i).getBasicSalary());
//            System.out.println(echarts.get(i).getName());
//            System.out.println(echarts.get(i).getBasicSalary());
//        }
//        res.put("name",name1);
//        System.out.println(res);
        System.out.println(echarts);
        return RespBean.success("获取金额成功", echarts);
    }
}
